/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.geftu.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author jorgenei
 */
@Entity
@Table(name = "tb_solucao")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Solucao.findAll", query = "SELECT t FROM Solucao t"),
    @NamedQuery(name = "Solucao.findByIdsol", query = "SELECT t FROM Solucao t WHERE t.idsol = :idsol"),
    @NamedQuery(name = "Solucao.findByDescricao", query = "SELECT t FROM Solucao t WHERE t.descricao = :descricao"),
    @NamedQuery(name = "Solucao.findByDtultalteracao", query = "SELECT t FROM Solucao t WHERE t.dtultalteracao = :dtultalteracao"),
    @NamedQuery(name = "Solucao.findByArqsolucao", query = "SELECT t FROM Solucao t WHERE t.arqsolucao = :arqsolucao")})
public class Solucao implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idsol")
    private Integer idsol;
    @Column(name = "descricao")
    private String descricao;
    @Column(name = "dtultalteracao")
    private String dtultalteracao;
    @Column(name = "arqsolucao")
    private String arqsolucao;
    @JoinColumn(name = "defeito", referencedColumnName = "idrel")
    @ManyToOne(optional = false)
    private Relato defeito;
    @JoinColumn(name = "responsavel", referencedColumnName = "iddes")
    @ManyToOne(optional = false)
    private Desenvolvedor responsavel;
    @JoinColumn(name = "categoriaerro", referencedColumnName = "idcat")
    @ManyToOne(optional = false)
    private Categoria categoriaerro;

    public Solucao() {
    }

    public Solucao(Integer idsol) {
        this.idsol = idsol;
    }

    public Integer getIdsol() {
        return idsol;
    }

    public void setIdsol(Integer idsol) {
        this.idsol = idsol;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public String getDtultalteracao() {
        return dtultalteracao;
    }

    public void setDtultalteracao(String dtultalteracao) {
        this.dtultalteracao = dtultalteracao;
    }

    public String getArqsolucao() {
        return arqsolucao;
    }

    public void setArqsolucao(String arqsolucao) {
        this.arqsolucao = arqsolucao;
    }

    public Relato getDefeito() {
        return defeito;
    }

    public void setDefeito(Relato defeito) {
        this.defeito = defeito;
    }

    public Desenvolvedor getResponsavel() {
        return responsavel;
    }

    public void setResponsavel(Desenvolvedor responsavel) {
        this.responsavel = responsavel;
    }

    public Categoria getCategoriaerro() {
        return categoriaerro;
    }

    public void setCategoriaerro(Categoria categoriaerro) {
        this.categoriaerro = categoriaerro;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idsol != null ? idsol.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Solucao)) {
            return false;
        }
        Solucao other = (Solucao) object;
        if ((this.idsol == null && other.idsol != null) || (this.idsol != null && !this.idsol.equals(other.idsol))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.geftu.model.Solucao[ idsol=" + idsol + " ]";
    }
    
}
